package com.ruicar.afs.cloud.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruicar.afs.cloud.admin.entity.SysPermission;

import java.util.List;

/**
 * The interface SysPermissionService.
 * <p>
 * Created on 2019-02-20
 *
 * @author Fzero
 */
public interface SysPermissionService extends IService<SysPermission> {
	/**
	 * 通过层级查找
	 * 默认升序
	 *
	 * @param level
	 * @return
	 */
	List<SysPermission> findByLevelOrderBySortOrder(Integer level);

	/**
	 * 通过parendId查找
	 *
	 * @param parentId
	 * @return
	 */
	List<SysPermission> findByParentIdOrderBySortOrder(String parentId);

	/**
	 * 通过类型和状态获取
	 *
	 * @param type
	 * @param status
	 * @return
	 */
	List<SysPermission> findByTypeAndStatusOrderBySortOrder(Integer type, String status);

	/**
	 * 通过名称获取
	 *
	 * @param title
	 * @return
	 */
	List<SysPermission> findByTitle(String title);

	/**
	 * 模糊搜索
	 *
	 * @param title
	 * @return
	 */
	List<SysPermission> findByTitleLikeOrderBySortOrder(String title);

	/**
	 * Find by user id list.
	 *
	 * @param userId the user id
	 * @return the list
	 */
	List<SysPermission> findByUserId(Long userId);
}
